local qunxian3__baishoukaiduo_yanyun = fk.CreateSkill {

  name = "qunxian3__baishoukaiduo_yanyun",

  tags = {},

}

Fk:loadTranslationTable {
  ["qunxian3__baishoukaiduo_yanyun"] = "焰云",
  [":qunxian3__baishoukaiduo_yanyun"] = [[你可将你的非伤害牌或场上装备区与判定区的牌当做不计入次数的【闪】，【桃】，【酒】，【无懈可击】使用。]],
  ['#qunxian3__baishoukaiduo_yanyun'] = '焰云：你可将你的非伤害牌或场上装备区与判定区的牌当做不计入次数的【闪】，【桃】，【酒】，【无懈可击】使用',
  ['#qunxian3__baishoukaiduo_yanyun-choose_card'] = '焰云：请选择一张牌',
  ["$qunxian3__baishoukaiduo_yanyun"] = "焰云",
}

qunxian3__baishoukaiduo_yanyun:addEffect("viewas", {
  anim_type = "offensive",
  pattern = "jink,peach,analeptic,nullification",
  prompt = "#qunxian3__baishoukaiduo_yanyun",
  filter_pattern = {
    max_num = 1,
    min_num = 1,
    pattern = ".|.|.|hand,equip"
  },
  interaction = function(self, player)
    local all_choices = { "jink", "peach", "analeptic", "nullification" }
    local choices = player:getViewAsCardNames("qunxian3__baishoukaiduo_yanyun", all_choices)
    if #choices == 0 then return end
    return UI.CardNameBox { choices = choices, all_choices = all_choices }
  end,
  expand_pile = function(self, player)
    local cards = {}
    local room = player.room
    for _, p in ipairs(Fk:currentRoom().alive_players) do
      if #p:getCardIds("je") > 0 then
        if p == player then
          table.insertTableIfNeed(cards, p:getCardIds("j"))
        else
          table.insertTableIfNeed(cards, p:getCardIds("ej"))
        end
      end
    end
    return cards
  end,
  card_filter = function(self, player, to_select, selected, selected_targets)
    return #selected == 0 and Fk:getCardById(to_select).is_damage_card ~= true
  end,
  card_num = 1,
  enabled_at_response = function(self, player, response)
    return not response
  end,
  view_as = function(self, player, cards)
    if #cards ~= 1 or self.interaction == nil or self.interaction.data == nil then return end
    local c = Fk:cloneCard(self.interaction.data)
    c.skillName = qunxian3__baishoukaiduo_yanyun.name
    c:addSubcard(cards[1])
    return c
  end,
})

qunxian3__baishoukaiduo_yanyun:addEffect("targetmod", {
  bypass_times = function(self, player, skill, scope, card)
    return card and scope == Player.HistoryTurn and table.contains(card.skillNames, qunxian3__baishoukaiduo_yanyun.name)
  end,
})


return qunxian3__baishoukaiduo_yanyun
